<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="box" id="box"></div>
    <script>
        var box = document.getElementById("box");
        // box.setAttribute("style","width:200px;height:200px;background:red;")

        // 元素节点的style属性
        // box.style.width="300px";
        // box.style.height="300px";
        // box.style.backgroundColor = "red";

        // cssText属性
        box.style.cssText="width:200px;height:200px;background:red;"
    </script>
</body>
</html>